Skip to content

PHPStan Level 4 Compliance#219

Merged
JJJ merged 4 commits intostuttter:masterfrom
lloc:feat/phpstan-level-4
Apr 1, 2025
Merged

PHPStan Level 4 Compliance#219
JJJ merged 4 commits intostuttter:masterfrom
lloc:feat/phpstan-level-4

Conversation

@lloc
Copy link
Contributor

@lloc lloc commented Mar 19, 2025

This PR addresses issues identified by PHPStan at level 4.

Changes:

  1. Removed unreachable code following WP_CLI::error() calls, as this function terminates script execution. cc @spacedmonkey @felixarntz.
  2. Refactored class initialization by extracting hook registrations from constructors into a dedicated add_hooks() method, ensuring the admin_bar property is properly utilized rather than only being written to.
  3. Fixed type safety by explicitly casting the return value of domain_exists() to boolean during comparisons.

@lloc
Copy link
Contributor Author

lloc commented Apr 1, 2025

@JJJ @spacedmonkey Do you think we can move this forward? ▶️

@JJJ JJJ merged commit ee7d436 into stuttter:master Apr 1, 2025
1 check passed
thefrosty added a commit to thefrosty/wp-multi-network that referenced this pull request Dec 3, 2025
* master:
  PHPStan Level 6 (stuttter#221)
  PHPStan Level 5 (stuttter#220)
  Update README.md
  PHPStan Level 4 Compliance (stuttter#219)
  PHPStan Level 3 (stuttter#218)
  PHPStan Level 2 (stuttter#217)
  PHPStan Level 1 (stuttter#215)

# Conflicts:
#	wp-multi-network/includes/classes/class-wp-ms-networks-admin.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants